<template>
	<view>
		<tm-cell :round="3" :margin="[0, 0, 0, 16]" :titleFontSize="30" title="设置操作密码" @click="updatePwd()"> </tm-cell>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				password: ''
			}
		},
		onLoad(id) {

			let phoneDate = id.data;
			this.id = phoneDate;
			this.getMb(phoneDate);
		},
		methods: {
			//查看用户信息
			getMb(phoneDate) {
				
				uni.request({
					url: "/app/mb/getMbInfo.do",
					method: 'GET',
					header: { // 设置请求的header
						'content-type': 'application/json', // 指定请求头，比如设置Content-Type
					},
					success: (res) => {
						let requ = res.data.data;
						this.password = requ.password;


						// 在请求成功时返回的数据
					}

				})

			},
			//跳转修改界面
			updatePwd() {
				
				if (this.password == "" || this.password == null) {
					uni.navigateTo({
						url: '/pages/myPage/addPwd?data=' + this.id,

					});
				} else {
					uni.navigateTo({
						url: '/pages/myPage/updatePwd?data=' + this.id
					});
				}


			}

		}
	}
</script>

<style>

</style>